package health_system.health_system.entity;

import jakarta.persistence.*;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Size;
import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
@Entity
@Table(name = "moment_media")
public class MomentMedia extends BaseEntity {

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "moment_id", nullable = false)
    private Moment moment;
    
    @NotBlank
    @Size(max = 255)
    @Column(nullable = false)
    private String mediaUrl;
    
    @Enumerated(EnumType.STRING)
    @Column(nullable = false)
    private MediaType mediaType;
    
    private Integer orderIndex = 0;
    
    @Size(max = 255)
    private String thumbnailUrl;
    
    private Integer duration; // for videos, in seconds
    
    public enum MediaType {
        IMAGE, VIDEO
    }
} 